package com.ruoyi.user.service;

import java.util.LinkedList;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.support.Convert;
import com.ruoyi.user.domain.Battery;
import com.ruoyi.user.mapper.BatteryMapper;

/**
 * 电量 服务层实现
 * 
 * @author ruoyi
 * @date 2019-01-30
 */
@Service
public class BatteryServiceImpl implements IBatteryService 
{
	@Autowired
	private BatteryMapper batteryMapper;

	/**
     * 查询电量信息
     * 
     * @param id 电量ID
     * @return 电量信息
     */
    @Override
	public Battery selectBatteryById(Integer id)
	{
	    return batteryMapper.selectBatteryById(id);
	}
	
	/**
     * 查询电量列表
     * 
     * @param battery 电量信息
     * @return 电量集合
     */
	@Override
	public LinkedList<Battery> selectBatteryList(Battery battery)
	{
	    return batteryMapper.selectBatteryList(battery);
	}
	
    /**
     * 新增电量
     * 
     * @param battery 电量信息
     * @return 结果
     */
	@Override
	public int insertBattery(Battery battery)
	{
	    return batteryMapper.insertBattery(battery);
	}
	
	/**
     * 修改电量
     * 
     * @param battery 电量信息
     * @return 结果
     */
	@Override
	public int updateBattery(Battery battery)
	{
	    return batteryMapper.updateBattery(battery);
	}

	/**
     * 删除电量对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteBatteryByIds(String ids)
	{
		return batteryMapper.deleteBatteryByIds(Convert.toStrArray(ids));
	}
	
}
